<template>
    <div>
        <van-row>
            <van-col span="23" offset="1">
                <h1>{{data.title}}</h1>
                <p>发布时间： {{data.upd_time}}</p>
                <div v-html="data.content"></div>

            </van-col>
        </van-row>
    </div>
</template>

<script>
    export default {
        name: "guideinfo",
        data(){
            return{
                url:'/app/wechat/guide/',
                //文章id
                id:-1,
                //文章数据
                data:{},
            }
        },
        created() {
            if(this.$route.query.id!==undefined){
                this.id = this.$route.query.id;
            }
            this.getData();
        },
        methods:{
            //获取数据
            getData(){
                this.axios.post(this.url + 'readApi/mid/2.html',{id:this.id}).then(({data}) => {
                    console.log(data);
                    if(data.error===0){
                        this.data = data.info
                        this.data.upd_time = this.data.upd_time.substr(0,10)
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>